local skynet = require "skynet"
local redis_tool = {}
local cluster = require "skynet.cluster"

function redis_tool.safe_hget(key, ...)
    local ok, res = cluster.call("redis", ".redis", "SafeHget", key, ...)
    log.info("redis_tool safe_hget res=", res)
    return res
end

function redis_tool.safe_incr(key, ...)
    local ok, res = cluster.call("redis", ".redis", "SafeIncr", key, ...)
    log.info("redis_tool safe_incr res=", res)
    return res
end

function redis_tool.safe_hset(key, ...)
    local ok, res = cluster.call("redis", ".redis", "SafeHset", key, ...)
    log.info("redis_tool safe_hset res=", res)
    return res
end

return redis_tool